﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace PascalTriangle
{
    public class Element
    {
        private long val;

        public long Val
        {
            get {
                elementSemaphore.WaitOne();
                return val; 
            }
            set { 
                val = value;
            }
        }

        public void ReleaseSemaphore()
        {
            elementSemaphore.Release();
        }
        private int threadID;

        public int ThreadID
        {
            get { return threadID; }
            set { threadID = value; }
        }
        private Semaphore elementSemaphore = new Semaphore(1,1);

        public Element()
        {
            val = 0;
        }


    }
}
